/*
 * @Author: Qimu
 * @Date: 2020-04-17 08:36:48
 * @LastEditors: Qimu
 * @LastEditTime: 2020-07-08 02:29:09
 * @Description: file content
 * @FilePath: \vue-admin-koa2\koa2_api\module\schama\user.js
 */
const mongoose = require('../db/mongodb');
const config = require('../config/config');

const userSchema = mongoose.Schema({
  user_name: { //用户名称
    type: String,
    required: true,
    trim: true
  },
  user_email: { //用户邮箱
    type: String,
    required: true,
    trim: true
  },
  user_mobile: { //用户电话
    type: String,
    required: true,
    trim: true
  },
  user_type: { //用户类型
    type: Number,
    default: 1 //1为普通用户 2为会员用户
  },
  user_status: { //用户状态
    type: Number,
    default: 1
  },
  user_registerTime: { //用户注册时间
    type: String,
    required: true,
    trim: true,
  }
})

module.exports = user = mongoose.model('User', userSchema, `${config.mongodb.table}user`);